package com.ruoyi.mes.systembasic.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.mes.systembasic.domain.SmesProduceSequenceResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mes.systembasic.mapper.SmesSequenceProduceMapper;
import com.ruoyi.mes.systembasic.domain.SmesSequenceProduce;
import com.ruoyi.mes.systembasic.service.ISmesSequenceProduceService;

/**
 * 序列Service业务层处理
 *
 * @author simpsense
 * @date 2020-12-10
 */
@Service
public class SmesSequenceProduceServiceImpl implements ISmesSequenceProduceService
{
    @Autowired
    private SmesSequenceProduceMapper smesSequenceProduceMapper;

    /**
     * 查询序列
     *
     * @param rowId 序列ID
     * @return 序列
     */
    @Override
    public SmesSequenceProduce selectSmesSequenceProduceById(Long rowId)
    {
        return smesSequenceProduceMapper.selectSmesSequenceProduceById(rowId);
    }

    /**
     * 查询序列列表
     *
     * @param smesSequenceProduce 序列
     * @return 序列
     */
    @Override
    public List<SmesSequenceProduce> selectSmesSequenceProduceList(SmesSequenceProduce smesSequenceProduce)
    {
        return smesSequenceProduceMapper.selectSmesSequenceProduceList(smesSequenceProduce);
    }

    /**
     * 新增序列
     *
     * @param smesSequenceProduce 序列
     * @return 结果
     */
    @Override
    public int insertSmesSequenceProduce(SmesSequenceProduce smesSequenceProduce)
    {
        smesSequenceProduce.setCreateTime(DateUtils.getNowDate());
        return smesSequenceProduceMapper.insertSmesSequenceProduce(smesSequenceProduce);
    }

    /**
     * 修改序列
     *
     * @param smesSequenceProduce 序列
     * @return 结果
     */
    @Override
    public int updateSmesSequenceProduce(SmesSequenceProduce smesSequenceProduce)
    {
        smesSequenceProduce.setUpdateTime(DateUtils.getNowDate());
        return smesSequenceProduceMapper.updateSmesSequenceProduce(smesSequenceProduce);
    }

    /**
     * 批量删除序列
     *
     * @param rowIds 需要删除的序列ID
     * @return 结果
     */
    @Override
    public int deleteSmesSequenceProduceByIds(Long[] rowIds)
    {
        return smesSequenceProduceMapper.deleteSmesSequenceProduceByIds(rowIds);
    }

    /**
     * 删除序列信息
     *
     * @param rowId 序列ID
     * @return 结果
     */
    @Override
    public int deleteSmesSequenceProduceById(Long rowId)
    {
        return smesSequenceProduceMapper.deleteSmesSequenceProduceById(rowId);
    }

    @Override
    public SmesProduceSequenceResult generateSequence(SmesSequenceProduce smesSequenceProduce) {
        return smesSequenceProduceMapper.generateSequence(smesSequenceProduce);
    }
}
